<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>畅读小说网</title>
    <style>
        /* 基本样式 */
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f5f5f5;
            color: #333;L
        }
        .container {
            width: 100%;
            margin: 0 auto;
        }

        /* 登录/注册页样式 */
        .login-container {
            max-width: 400px;
            margin: 100px auto;
            padding: 30px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        h2 {
            text-align: center;
            margin-bottom: 30px;
            color: #333;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        input[type="text"],
        input[type="password"],
        input[type="email"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            width: 100%;
        }
        .btn:hover {
            background-color: #0069d9;
        }
        .register-link {
            text-align: center;
            margin-top: 20px;
        }
        .alert {
            padding: 10px;
            margin-bottom: 20px;
            border-radius: 4px;
        }
        .alert-error {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        .alert-success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        /* 首页样式 */
        .site-header {
            background-color: #fff;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            padding: 15px 0;
        }
        .header-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }
        .logo h1 {
            margin: 0;
            font-size: 24px;
            color: #007bff;
        }
        .main-nav ul {
            list-style: none;
            display: flex;
            margin: 0;
            padding: 0;
        }
        .main-nav li {
            margin: 0 15px;
        }
        .main-nav a {
            text-decoration: none;
            color: #333;
            font-weight: bold;
        }
        .main-nav a:hover {
            color: #007bff;
        }
        .user-nav {
            display: flex;
            align-items: center;
        }
        .user-nav a, .welcome-msg {
            margin-left: 15px;
            text-decoration: none;
            color: #333;
        }
        .user-nav a:hover {
            color: #007bff;
        }
        .login-btn, .register-btn, .logout-btn, .admin-link, .apply-btn {
            padding: 6px 12px;
            border-radius: 4px;
            background-color: #007bff;
            color: white !important;
        }
        .register-btn {
            background-color: #28a745;
        }
        .logout-btn {
            background-color: #dc3545;
        }
        .admin-link {
            background-color: #6c757d;
        }

        .main-content {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        .banner {
            background-color: #e9ecef;
            padding: 50px 20px;
            text-align: center;
            margin-bottom: 30px;
            border-radius: 8px;
        }
        .search-box {
            max-width: 600px;
            margin: 0 auto;
        }
        .search-box input {
            width: 70%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 4px 0 0 4px;
            font-size: 16px;
        }
        .search-box button {
            width: 25%;
            padding: 12px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 0 4px 4px 0;
            cursor: pointer;
            font-size: 16px;
        }

        .section-title {
            border-left: 4px solid #007bff;
            padding-left: 10px;
            margin-bottom: 20px;
        }
        .novel-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 20px;
        }
        .novel-card {
            background-color: #fff;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
        }
        .novel-card:hover {
            transform: translateY(-5px);
        }
        .novel-cover {
            height: 200px;
            overflow: hidden;
        }
        .novel-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .no-cover {
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #e9ecef;
            color: #6c757d;
        }
        .novel-info {
            padding: 15px;
        }
        .novel-title {
            margin: 0 0 5px;
            font-size: 18px;
        }
        .novel-author, .novel-category {
            margin: 0 0 5px;
            font-size: 14px;
            color: #6c757d;
        }
        .novel-desc {
            font-size: 14px;
            margin: 10px 0 0;
            line-height: 1.4;
        }

        .become-author {
            margin: 50px 0;
        }
        .author-promo {
            background-color: #e9ecef;
            padding: 30px;
            text-align: center;
            border-radius: 8px;
        }
        .apply-btn {
            display: inline-block;
            padding: 10px 20px;
            margin-top: 15px;
            text-decoration: none;
        }

        .site-footer {
            background-color: #343a40;
            color: #fff;
            padding: 50px 0 20px;
            margin-top: 50px;
        }
        .footer-content {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            padding: 0 20px;
        }
        .footer-logo h2 {
            margin: 0 0 10px;
            text-align: left;
            color: #fff;
        }
        .footer-links h3, .footer-contact h3 {
            margin-bottom: 15px;
            color: #fff;
        }
        .footer-links ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .footer-links li {
            margin-bottom: 10px;
        }
        .footer-links a {
            color: #adb5bd;
            text-decoration: none;
        }
        .footer-links a:hover {
            color: #fff;
        }
        .copyright {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #495057;
            color: #adb5bd;
        }


        /* 响应式调整 */
        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                text-align: center;
            }
            .main-nav, .user-nav {
                margin-top: 15px;
            }
            .novel-grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            }
        }
    </style>
</head>
<header class="site-header">
    <div class="header-content">
        <div class="logo">
            <h1>畅读小说网</h1>
        </div>
        <nav class="main-nav">
            <ul>
                <li><a href="{% url 'frontend_home' %}">首页</a></li>
                <li><a href="{% url 'novel_list' %}">分类</a></li>
            </ul>
        </nav>
        <div class="user-nav">
            {% if user.is_authenticated %}
                <span class="welcome-msg">欢迎，{{ user.username }}</span>
                {% if admin_link %}
                    <a href="{% url 'admin:index' %}" class="admin-link">管理后台</a>
                {% endif %}
                {% if user.role == 'author' %}
                    <a href="{% url 'author_center' %}"" class="author-link">作家中心</a>
                {% endif %}
                <a href="{% url 'user_profile' %}" class="user-center">个人中心</a>
                <a href="{% url 'bookshelf' %}" class="bookshelf">我的书架</a>
                <a href="{% url 'logout' %}" class="logout-btn">退出</a>
            {% else %}
                <a href="{% url 'login' %}" class="login-btn">登录</a>
                <a href="{% url 'register' %}" class="register-btn">注册</a>
            {% endif %}
        </div>
    </div>
</header>
{% block content %}

{% endblock %}
<footer class="site-footer">
    <div class="footer-content">
        <div class="footer-logo">
            <h2>畅读小说网</h2>
            <p>免费小说阅读平台</p>
        </div>
        <div class="footer-links">
            <h3>快速链接</h3>
            <ul>
                <li><a href="#">关于我们</a></li>
                <li><a href="#">联系我们</a></li>
                <li><a href="#">用户协议</a></li>
                <li><a href="#">隐私政策</a></li>
            </ul>
        </div>
        <div class="footer-contact">
            <h3>联系我们</h3>
            <p>邮箱: contact@novel.example.com</p>
        </div>
    </div>
    <div class="copyright">
        <p>&copy; 2025 畅读小说网. 保留所有权利.</p>
    </div>
</footer>